package pl.koziolekweb.jqr.data;

public enum StandardSeparator implements Separator {
	WORD {
		@Override
		public String getSeparatorString() {
			return " ";
		}

		@Override
		public String removeAdditionalCharacters(String orginalText) {
			String splitedText = orginalText.replaceAll("\b|\t|\n|\f|\r", " ");
			splitedText = splitedText.replaceAll("\\s{2,}", " ");
			return splitedText;
		}
	},
	SENTENCE {
		@Override
		public String getSeparatorString() {
			return "\\.|\\!|\\?";
		}

		@Override
		public String removeAdditionalCharacters(String orginalText) {
			String splitedText = orginalText.replaceAll("\b|\t|\n|\f|\r", " ");
			splitedText = splitedText.replaceAll("\\s{2,}", " ");
			return splitedText;
		}
	},
	PARAGRAPH {

		@Override
		public String getSeparatorString() {
			return "\n";
		}

		@Override
		public String removeAdditionalCharacters(String orginalText) {
			return orginalText;
		}
	}
}
